import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Test {
    public static void main(String[] args) {
        // 1. 获取数据
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
        int[] nums = new int[count];
        for (int i = 0; i < count; i++) {
            nums[i] = scanner.nextInt();
        }
        // 2. 保存数据和数据的数量
        HashMap<Integer, Integer> map = new HashMap<>();
        for (int i = 0; i < count; i++) {
            map.put(nums[i], map.getOrDefault(nums[i], 0) + 1);
        }
        int maxKey = 0;
        int maxValue = 0;
        Set<Map.Entry<Integer, Integer>> set = map.entrySet();
        for (Map.Entry<Integer, Integer> entry: set) {
            int value = entry.getValue();
            if(maxValue < value) {
                maxKey = entry.getKey();
                maxValue = entry.getValue();
            }else if(maxValue == value) {
                if(maxKey < entry.getKey()) {
                    maxKey = entry.getKey();
                }
            }
        }
        System.out.println(maxKey + " : " + maxValue);
    }
}











